<template>
    <div>
        <div class="container">
            <el-menu default-active="1-4-1" class="el-menu-vertical-demo">
                <el-menu-item index="1">
                    <i class="el-icon-menu"></i>
                    <router-link class="list-group-item" active-class="active" to="/curd" slot="title">用户列表</router-link>
                </el-menu-item>
                <el-menu-item index="2">
                    <i class="el-icon-menu"></i>
                    <span slot="title">日志查看</span>
                </el-menu-item>
            </el-menu>
        </div>
        <h2>姓名:{{stuname}}</h2>
        <h2>身份:{{result}}</h2>
        <router-view></router-view>
    </div>
</template>

<script>
    export default {
        name: 'AdminIndex',
        data(){
            return{
                stuname : sessionStorage.getItem('loginName'),
                stustatus : sessionStorage.getItem('status'),
            }
        },
        computed:{
            result(){
                let showstatus = '';
                if(this.stustatus === '0'){
                    showstatus = '管理员';
                } else if (this.stustatus === '1'){
                    showstatus = '老师';
                } else if (this.stustatus === '2'){
                    showstatus = '学生';
                }
                return showstatus;
            }
        },

    }
</script>

<style scoped>

    .container{
        background-position: center;
        height: 100%;
        width: 100%;
        background-size: cover;
        position: fixed;
    }

    .el-menu-vertical-demo:not(.el-menu--collapse) {
        width: 200px;
        min-height: 400px;
    }

</style>